//
//  ViewController.m
//  5.5_ZY
//
//  Created by bmli on 16/5/5.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "AppDelegate.h"
#import "Bmli.h"
#import "ChangeButton.h"
@interface ViewController ()
@property (nonnull ,retain)NSTimer * timer;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self create];
    [self  createButton];
}

- (void)create{
    // 红
    Bmli * redColor = [[Bmli alloc]initWithFrame:CGRectMake(30, 30, 315, 607)];
    [self.view addSubview: redColor];
    redColor.backgroundColor = [UIColor redColor];
    [redColor release];
    // 橙
    Bmli *orangeColor = [[Bmli alloc]initWithFrame:CGRectMake(50, 50, 275, 567)];
    [self.view addSubview:orangeColor];
    orangeColor.backgroundColor = [UIColor orangeColor];
    [orangeColor release];
    // 黄
    Bmli * yellowColor = [[Bmli alloc]initWithFrame:CGRectMake(70, 70, 235, 527)];
    [self.view addSubview:yellowColor];
    yellowColor.backgroundColor = [UIColor yellowColor];
    [yellowColor release];
    // 绿
    Bmli * greeColor = [[Bmli alloc]initWithFrame:CGRectMake(90, 90, 195, 487)];
    greeColor.backgroundColor = [UIColor greenColor];
    [self.view addSubview:greeColor];
    [greeColor release];
    
    // 青
    Bmli *cyanColor = [[Bmli alloc]initWithFrame:CGRectMake(110, 110, 155, 447)];
    cyanColor.backgroundColor = [UIColor cyanColor];
    [self.view addSubview: cyanColor];
    [cyanColor release];
    // 蓝
    Bmli *buleColor = [[Bmli alloc]initWithFrame:CGRectMake(130, 130, 115, 407)];
    buleColor.backgroundColor = [UIColor blueColor];
    [self.view addSubview:buleColor];
    [buleColor release];

    // 紫
    Bmli *peopleColor = [[Bmli alloc]initWithFrame:CGRectMake(150, 150, 75, 367)];
    peopleColor.backgroundColor = [UIColor purpleColor];
    [self.view addSubview:peopleColor];
    [peopleColor release];
    
    // 灰
    Bmli *greyColor = [[Bmli alloc]initWithFrame:CGRectMake(170, 170, 35, 327)];
    greyColor .backgroundColor = [UIColor grayColor];
    [self.view addSubview:greyColor];
    [greyColor release];
    
}

- (void)createButton{
    ChangeButton * changeColor = [ChangeButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview: changeColor];
    changeColor.frame = CGRectMake(50, 50, 80, 80);
    [changeColor setTitle:@"包" forState:UIControlStateNormal];
    changeColor.backgroundColor = [UIColor blackColor];
    
    
    ChangeButton * changeColor1 = [ChangeButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:changeColor1];
    changeColor1.frame = CGRectMake(250, 50, 80, 80);
    [changeColor1 setTitle:@"虞" forState:UIControlStateNormal];
    changeColor1.backgroundColor = [UIColor blackColor];
    
    
    
    
   
}

- (void)handleButton{
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
